<?php

/**
 * projet form.
 *
 * @package    gesp
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class projetForm extends BaseprojetForm {
	public function configure() {
		$this->setWidget('prj_date_debut', new DatePickerWidget(array('default' => date('d/m/Y'))));
		$this->setWidget('prj_date_fin', new DatePickerWidget());

		$this->widgetSchema->setLabel('prj_nom', 'Nom');
		$this->widgetSchema->setLabel('prj_date_debut', 'Début');
		$this->widgetSchema->setLabel('prj_date_fin', 'Fin');

		$this->setValidator(
			'prj_date_debut',
			new ValidatorDate(array(
				'required' => true,
				'date_format' => '/^(?P<day>\d+)\/(?P<month>\d+)(\/(?P<year>\d+))?/',
			))
		);
		$this->setValidator(
			'prj_date_fin',
			new ValidatorDate(array(
				'required' => false,
				'date_format' => '/^(?P<day>\d+)\/(?P<month>\d+)(\/(?P<year>\d+))?/',
			))
		);
	}
}
